﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XiDainChangAn.OA.Common
{
    public static class TypeConvertHelper
    {
        public static T GetCustomAttribute<T>(this Type type, bool inherit) where T : Attribute
        {
            var obj = type.GetCustomAttributes(typeof(T), inherit);
            if (obj != null)
            {
                return (T)obj.FirstOrDefault();
            }
            return null;
        }
    }
}
